
package character_11_;

/**
 *
 * @author Administrator
 */
public class Consumer implements Runnable{
    
    private Clerk2 clerk;
    
    public Consumer(Clerk2 clerk){
    
        this.clerk = clerk;
    }
    
    public void run(){
    
        System.out.println("消费者开始消耗整数....");
        for (int i = 0; i <= 10; i++) {
            try {
                clerk.getProduct();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
